home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Apple II / Essentials / Essentials.sea / File.Type.Notes / FTN.B6.XXXX < prev    next >
Encoding:
Text File  |  1993-06-15  |  4.2 KB  |  86 lines  |  [TEXT/GEOL]

  1. Apple II
  2. File Type Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. File Type:       $B6 (182)
  7. Auxiliary Type:  All
  8.  
  9. Full Name:       ProDOS 16 or GS/OS Permanent Initialization File
  10. Short Name:      Permanent initialization file
  11.  
  12. Modified by:     Matt Deatherage                                     May 1992
  13. Written by:      Matt Deatherage                               September 1990
  14.  
  15. Files of this type contain initialization code that does not get unloaded.
  16.  
  17. CHANGES SINCE SEPTEMBER 1990:  Added new information pertaining to System
  18. Software 6.0 and answered some commonly asked questions.
  19. _____________________________________________________________________________
  20.  
  21.  
  22. Files of type $B6 contain permanent initialization code in OMF format.  Such
  23. files are often referred to as "inits."  They are loaded by GS/OS at boot time
  24. and are never unloaded.  The auxiliary type is RESERVED except for bit 15--if
  25. bit 15 is set, the initialization file is not loaded at boot time.
  26.  
  27. The structure of an init is similar to that of an application.  The first byte
  28. of the loaded code image (inits are load files) is the entry point, and the
  29. init must end with an RTL instruction.  When GS/OS transfers control to a
  30. permanent initialization file, the processor is in 16-bit native mode.  The A
  31. register contains the init's user ID, D points to the bottom of a 4K stack and
  32. direct-page area and S points to near the top of that area.  (If the init has
  33. an OMF stack and direct page segment linked in, the D and S registers point to
  34. it instead.)  The data bank register is not defined; you should save it, set
  35. it and restore it if you use absolute addressing.
  36.  
  37. While all tools are available to be started, that doesn't mean tools should
  38. necessarily be started.  Inits can be loaded after boot time (such as with IR
  39. 2.0, DTS Sample Code for an Apple IIgs Finder Extension), and blindly
  40. attempting to start and shut down tools without first checking their status
  41. can be disastrous in such instances.  In particular, inits should never call
  42. TLStartUp or TLShutDown, and should check for the presence of other tools
  43. through each tool's status function before starting it up.
  44.  
  45. If you're considering starting a tool after init time and leaving it started
  46. (which is only possible when your code gets control after init time), you must
  47. do two things:
  48.  
  49.       1. Apply for your Certificate of IIgs Deityship at the Matt
  50.          & Dave Ministry of Bits.  Do not continue until you
  51.          recieve your certificate.
  52.       2. Read Apple IIgs Technical Note #53, "NDAs and Tools," and
  53.          do what it says.
  54.  
  55. Inits that need to tell the difference between boot time and later loading
  56. times (for example, a RAM disk restoration init) can check the result of the
  57. GS/OS call GetName--if there is no name, the system's currently being started
  58. up.
  59.  
  60. Permanent inits are called at boot time and left in memory until the system is
  61. shut down.  However, GS/OS does not call them again (even on a return from
  62. ProDOS 8).  If your permanent init wants to periodically get control, it can
  63. use features like heartbeat tasks (installed with SetHeartBeat and IntSource),
  64. GS/OS notification procedures (AddNotifyProc), inter-process communication
  65. features (AcceptRequests) or Run Queue tasks (AddToRunQ).
  66.  
  67. Your permanent init can tell GS/OS it should be unloaded after execution.
  68. Above GS/OS's RTL address on the stack is a WORD value of $0000.  If your init
  69. sets bit zero of this word (LDA #1, STA 4,S assuming you haven't pushed
  70. anything on the stack), GS/OS unloads your init when you return control,
  71. treating it as if it were a temporary init file.  This can be useful for inits
  72. that operate with certain hardware--if the hardware isn't present, the init
  73. can go away.
  74.  
  75. WARNING: This WORD space is not available to permanent
  76.          initialization files that execute from a user's folder on
  77.          an AppleShare file server at boot time unless you're
  78.          using System Software 6.0 or later.
  79.  
  80.  
  81. Further Reference
  82. _____________________________________________________________________________
  83.  
  84.    o   GS/OS Reference
  85.    o   File Type Note for File Type $B7, Temporary Initialization Files
  86.